<?php
 /*******************************************************************************
 * @filename: index.ctp
 *
 * @author: immer_baldos
 *
 * @description: customers/index view
 *
 * @history:
 *
 *   VERSION   DATE                   BY          NOTES
 *  ---------------------------------------------------------------
 *     1.0     September  9, 2009     immer       initial bake
 *
 *     2.0     September 16, 2009     immer       comment out unused menus
 *
 ******************************************************************************/
 ?>
<div class="customers index">
<h2><?php __('Customers');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<!--	<th><?php echo $paginator->sort('id');?></th> -->
	<th><?php echo $paginator->sort('name');?></th>
<!--
	<th><?php echo $paginator->sort('billing_address');?></th>
	<th><?php echo $paginator->sort('shipping_address');?></th>
-->
	<th><?php echo $paginator->sort('credit_limit');?></th>
	<th><?php echo $paginator->sort('contact');?></th>
	<th><?php echo $paginator->sort('created');?></th>
	<th><?php echo $paginator->sort('tin');?></th>
	<th><?php echo $paginator->sort('mode_of_payment');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($customers as $customer):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
<!--
		<td>
			<?php echo $customer['Customer']['id']; ?>
		</td>
-->
		<td>
			<?php echo $customer['Customer']['name']; ?>
		</td>
<!--
		<td>
			<?php echo $customer['Customer']['billing_address']; ?>
		</td>
		<td>
			<?php echo $customer['Customer']['shipping_address']; ?>

		</td>  -->
		<td>
			<?php echo $customer['Customer']['credit_limit']; ?>
		</td>
		<td>
			<?php echo $customer['Customer']['contact']; ?>
		</td>
		<td>
			<?php echo $customer['Customer']['created']; ?>
		</td>
		<td>
			<?php echo $customer['Customer']['tin']; ?>
		</td>
		<td>
			<?php echo $customer['Customer']['mode_of_payment']; ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('View', true), array('action' => 'view', $customer['Customer']['id'])); ?>
			<?php echo $html->link(__('Edit', true), array('action' => 'edit', $customer['Customer']['id'])); ?>
			<?php echo $html->link(__('Delete', true), array('action' => 'delete', $customer['Customer']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $customer['Customer']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('New Customer', true), array('action' => 'add')); ?></li>
		<li><?php echo $html->link(__('List Orders', true), array('controller' => 'orders', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Order', true), array('controller' => 'orders', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Payments', true), array('controller' => 'payments', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Payment', true), array('controller' => 'payments', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Transactions', true), array('controller' => 'transactions', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Transaction', true), array('controller' => 'transactions', 'action' => 'add')); ?> </li>
	</ul>
</div>
